package com.lsl.bhllserver.service.product;

import java.util.List;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;

import com.lsl.bhllserver.entity.Product;
import com.lsl.bhllserver.service.func.IDeleteProd;

@Service
public class AdminProdService extends ProductService{

    @CacheEvict(value = "allProd", key = "'allProd'")
    public boolean deleteProd(IDeleteProd dp) {
        return productDAO.delete(dp.deleteProd());
    }

    @Cacheable(value = "allProd", key = "'allProd'")
    public List<Product> getAllProd() {
        return productDAO.getAll();
    }
}
